package com.mm.controller;

import com.alibaba.fastjson.JSONObject;
import com.mm.Bean.User;
import com.mm.mvc.MyController;
import com.mm.mvc.MyRequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;

@MyController("/user")
public class UserController
{
    @MyRequestMapping("/list.do")
    public Object findList(HttpServletRequest request, HttpServletResponse response) throws Exception
    {
        User user = new User();
        user.setUsername("Mac");
        user.setAge(33);

        response.getWriter().write("list.do result page, this is test page.");
        response.getWriter().write(JSONObject.toJSONString(user));
        return user;
    }
}
